import { createBrowserRouter } from 'react-router-dom'
import {
  DesktopOutlined,
  FileOutlined,
  PieChartOutlined,
  TeamOutlined,
  UserOutlined,
} from '@ant-design/icons';
import Home from '../props/home/Index'
import Login from '../props/login/Index'
import Order from '../props/order/Index'
import List from '../props/list/Index'
import Orderlist from '../props/order/orderlist/Index'
export const homerouter=[
    {
        path:'/home/order',
        element:<Order></Order>,
        title:'订单',
        Icon:<DesktopOutlined></DesktopOutlined>,
        children:[
            {
                path:'/home/order/orderlist',
                element:<Orderlist></Orderlist>,
                title:'三级'
            }
        ]
    },
    {
        path:'/home/list',
        element:<List></List>,
        title:'列表',
        Icon:<FileOutlined></FileOutlined>
    }
]
const routers = createBrowserRouter([
    { index: true, element: <Home></Home> },
    {
        path: '/home',
        element:<Home></Home>,
        children:homerouter
    },
    {
        path: '/login',
        element: <Login></Login>
    },
    {
        path: '/xq:id',
        lazy: async () => {
            const { default: Xq, loader } = await import('../props/xq/Index')
            return {
                element: <Xq></Xq>,
                loader
            }
        }
    }
])
export default routers